1 using UnityEngine;
2 using
System.Collections;
3
4
5 ///
<summary>
6 ///
base class for position, scale, eulers and the generic Vector3 props
7 ///
</summary>
8 public
abstract class AbstractVector3TweenProperty : AbstractTweenProperty
9 {
10     
protected Transform _target;
11     
12     
protected Vector3 _originalEndValue;
13     
protected Vector3 _startValue;
14     
protected Vector3 _endValue;
15     
protected Vector3 _diffValue;
16     
17     
18     
public AbstractVector3TweenProperty()
19     {}
20     
21     
22     
public AbstractVector3TweenProperty( Vector3 endValue, bool isRelative = false ) : base( isRelative )
23     {
24         _originalEndValue = endValue;
25     }
26
27
28     
public override bool validateTarget( object target )
29     {
30         
return target is Transform;
31     }
32     
33     
34     
public override void prepareForUse()
35     {
36         
if( _isRelative && !_ownerTween.isFrom )
37             _diffValue = _endValue;
38         
else
39             _diffValue = _endValue - _startValue;
40     }
41     
42     
43     
public void resetWithNewEndValue( Vector3 endValue )
44     {
45         _originalEndValue = endValue;
46         prepareForUse();
47     }
48     
49 }



Trò chơi Angry Birds trong UNITY Engine 31.660 lượt xem

Gõ tìm kiếm nhanh...